/**
 * 
 */
package sk.gtug.googleek.client;

import sk.gtug.googleek.client.place.HomePlace;
import sk.gtug.googleek.client.place.UpcomingActivitiesPlace;
import sk.gtug.googleek.client.presenter.HomePresenter;
import sk.gtug.googleek.client.presenter.UpcomingActivitiesPresenter;
import sk.gtug.googleek.client.view.HomePage;
import sk.gtug.googleek.client.view.UpcomingActivitiesPanel;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.google.inject.Inject;

/**
 * @author ladislav.gazo
 */
public class GoogleekActivityMapper implements ActivityMapper {
	@Inject
	HomePresenter homePresenter;
	
	@Override
	public Activity getActivity(Place place) {
		if(place instanceof UpcomingActivitiesPlace) {
			return new UpcomingActivitiesPresenter(new UpcomingActivitiesPanel());
		} else if(place instanceof HomePlace) {
			return homePresenter;
		}
		return null;
	}

}
